package ynu.lcy.elememicroservicegateway.service;

import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Set;

@Service
public class NonceService {
    private final Set<String> usedNonces = new HashSet<>();

    public boolean isNonceUsed(String nonce) {
        return usedNonces.contains(nonce);
    }

    public void markNonceAsUsed(String nonce) {
        usedNonces.add(nonce);
    }
}

